// 关键是快速算次幂 -- 递归
double Power(double base, int exponent)
{
    if (base == 0 || exponent < -1e9 || exponent > 1e9) 
            return 0;
    if (exponent == 0) 
        return 1;
     
    if (exponent > 0){
        if (exponent % 2 == 0){
            double res = Power(base, exponent/2);
            return res * res;
        }
        else if (exponent % 2 == 1){
            double res = Power(base, exponent/2);
            return base * res * res;
        }
    }
    else if (exponent < 0){
        exponent = -exponent;
        if (exponent % 2 == 0){
            double res = Power(base, exponent/2);
            return 1 / (res * res);
        }
        else if (exponent % 2 == 1){
            double res = Power(base, exponent/2);
            return 1 / (base * res * res);
        }
    }
}